#import "RadiateLuminousController.h"
        
#import "RadiateLuminousModel.h"
#import "RadiateLuminousCell.h"
#import "Masonry.h"

@interface RadiateLuminousController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *xenophileElevateTableView;
@property (nonatomic, strong) NSMutableArray *radiateArr;

@end

@implementation RadiateLuminousController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self laughterKaleidoscopeNightfallSetupui];
	[self xenophileJourneyFlourishfetchData];
}


//: 懒加载数据模型数组
- (NSMutableArray *)radiateArr {
	if (!_radiateArr) {
		_radiateArr = [NSMutableArray array];
	}
	return _radiateArr;
}

- (void)laughterKaleidoscopeNightfallSetupui {
    self.xenophileElevateTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.xenophileElevateTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    self.xenophileElevateTableView.estimatedRowHeight = 0;
    self.xenophileElevateTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.xenophileElevateTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
    self.xenophileElevateTableView.delegate = self;
    self.xenophileElevateTableView.dataSource = self;
    self.xenophileElevateTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.xenophileElevateTableView.showsVerticalScrollIndicator = NO;
    self.xenophileElevateTableView.showsHorizontalScrollIndicator = NO;
    self.xenophileElevateTableView.backgroundColor = UIColor.clearColor;
    [self.xenophileElevateTableView registerClass:[RadiateLuminousCell class] forCellReuseIdentifier:NSStringFromClass([RadiateLuminousCell class])];
    [self.view addSubview:self.xenophileElevateTableView];
    [self.xenophileElevateTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.equalTo(self.view);
        make.top.equalTo(self.view);
        make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
    }];
}

//: 获取数据模型
- (void)xenophileJourneyFlourishfetchData {
	
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.radiateArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    RadiateLuminousCell *questQuirk = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([RadiateLuminousCell class])];
    if (questQuirk == nil) {
        questQuirk = [[RadiateLuminousCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([RadiateLuminousCell class])];
    }
    questQuirk.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return questQuirk;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	RadiateLuminousModel *oliveWonder = self.radiateArr[indexPath.row];
	return oliveWonder.gratitudeCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
